package com.tax.enums;

/**
 * 登录类型枚举
 */
public enum LoginTypeEnum {

    VALIDCODE("validcode", "验证码"),
    PASSWORD("password", "密码");

    private String code;
    private String desc;

    LoginTypeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static LoginTypeEnum find(String code) {
        if (code == null) {
            return null;
        }
        for (LoginTypeEnum s : values()) {
            if (s.code.equals(code)) {
                return s;
            }
        }
        return null;
    }

}
